package apIExercise.exception;

public class FinallDemo2 {
    public static void main(String[] args) {
        /*
        System.out.println("从海贼开始");
        try {
            String s = " ";
            System.out.println(s.charAt(0));
            return;
        } catch (IndexOutOfBoundsException e) {
            System.out.println("出现下标越界已解决");
            //e.printStackTrace();
        } finally {
            System.out.println("阿芬爱上了阿强");
        }
        System.out.println("到海王结束");

         */
        try{
            String a="";
            System.out.println(a.charAt(5));
            String a1=" ";
            System.out.println(a1.charAt(8));
        }catch (IndexOutOfBoundsException e ){
            System.out.println("出错并解决");
        }catch (Exception e){
            System.out.println("解决完成");
        }finally {
            System.out.println("好好学习，月拿50个w");
        }
    }
}
